﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DesmoPlugin
{
    public partial class DesmoPluginSupplySet : Form
    {
        public static string profileHerbalism;
        public static string profileMining;
        public static string profileFishing;
        public static string profileSkinning;
        public static string profileClothes;

        public DesmoPluginSupplySet()
        {
            InitializeComponent();
            
        }


       
        private void profileHerbalismButton_Click(object sender, EventArgs e)
        {
            profileHerbalismDialog.ShowDialog();
            profileHerbalismDialog.InitialDirectory = XmlHandler.HBpath;
        }

        private void profileHerbalismDialog_FileOk(object sender, CancelEventArgs e)
        {
            profileHerbalism = profileHerbalismDialog.FileName;
            profileHerbalismTextBox.Text = profileHerbalism;
        }

        private void profileMiningButton_Click(object sender, EventArgs e)
        {
            profileMiningDialog.ShowDialog();
            profileMiningDialog.InitialDirectory = XmlHandler.HBpath;
        }

        private void profileMiningDialog_FileOk(object sender, CancelEventArgs e)
        {
            profileMining = profileMiningDialog.FileName;
            profileMiningTextBox.Text = profileMining;
        }

        private void profileFishingButton_Click(object sender, EventArgs e)
        {
            profileFishingDialog.ShowDialog();
            profileFishingDialog.InitialDirectory = XmlHandler.HBpath;
        }

        private void profileFishingDialog_FileOk(object sender, CancelEventArgs e)
        {
            profileFishing = profileFishingDialog.FileName;
            profileFishingTextBox.Text = profileFishing;
        }

        private void profileSkinningButton_Click(object sender, EventArgs e)
        {
            profileSkinningDialog.ShowDialog();
            profileSkinningDialog.InitialDirectory = XmlHandler.HBpath;
        }

        private void profileSkinningDialog_FileOk(object sender, CancelEventArgs e)
        {
            profileSkinning = profileSkinningDialog.FileName;
            profileSkinningTextBox.Text = profileSkinning;
        }

        private void profileClothesButton_Click(object sender, EventArgs e)
        {
            profileClothesDialog.ShowDialog();
            profileClothesDialog.InitialDirectory = XmlHandler.HBpath;
        }

        private void profileClothesDialog_FileOk(object sender, CancelEventArgs e)
        {
            profileClothes = profileClothesDialog.FileName;
            profileClothesTextBox.Text = profileClothes;
        }

        private void supplySourceSelect_SelectedIndexChanged(object sender, EventArgs e)
        {
            switch(supplySourceSelect.SelectedIndex)
            {
                case 0:         //None
                    {
                        profileMiningTextBox.Enabled = false;
                        profileHerbalismTextBox.Enabled = false;
                        profileSkinningTextBox.Enabled = false;
                        profileFishingTextBox.Enabled = false;
                        profileClothesTextBox.Enabled = false;
                        
                        supplyGhostIronOreTextBox.Enabled = false;
                        supplyShaCrystalTextBox.Enabled = false;
                        supplyMysteriousEssenceTextBox.Enabled = false;
                        supplyHerbsTextBox.Enabled = false;
                        supplyLivingSteelTextBox.Enabled = false;
                        supplyTrilliumBarTextBox.Enabled = false;
                        supplyGhostIronBarTextBox.Enabled = false;
                        supplyExoticLeatherTextBox.Enabled = false;
                        supplyPrismaticScaleTextBox.Enabled = false;
                        supplyWindwoolClothTextBox.Enabled = false;






                        break;
                    }
                case 1:         //Gather with alts
                    {
                        profileMiningTextBox.Enabled = true;
                        profileHerbalismTextBox.Enabled = true;
                        profileSkinningTextBox.Enabled = true;
                        profileFishingTextBox.Enabled = true;
                        profileClothesTextBox.Enabled = true;

                        supplyGhostIronOreTextBox.Enabled = false;
                        supplyShaCrystalTextBox.Enabled = false;
                        supplyMysteriousEssenceTextBox.Enabled = false;
                        supplyHerbsTextBox.Enabled = false;
                        supplyLivingSteelTextBox.Enabled = false;
                        supplyTrilliumBarTextBox.Enabled = false;
                        supplyGhostIronBarTextBox.Enabled = false;
                        supplyExoticLeatherTextBox.Enabled = false;
                        supplyPrismaticScaleTextBox.Enabled = false;
                        supplyWindwoolClothTextBox.Enabled = false;
                        
                        break;
                    }
                case 2:     //Buy from AH
                    {
                        profileMiningTextBox.Enabled = false;
                        profileHerbalismTextBox.Enabled = false;
                        profileSkinningTextBox.Enabled = false;
                        profileFishingTextBox.Enabled = false;
                        profileClothesTextBox.Enabled = false;
                        
                        supplyGhostIronOreTextBox.Enabled = true;
                        supplyShaCrystalTextBox.Enabled = true;
                        supplyMysteriousEssenceTextBox.Enabled = true;
                        supplyHerbsTextBox.Enabled = true;
                        supplyLivingSteelTextBox.Enabled = true;
                        supplyTrilliumBarTextBox.Enabled = true;
                        supplyGhostIronBarTextBox.Enabled = true;
                        supplyExoticLeatherTextBox.Enabled = true;
                        supplyPrismaticScaleTextBox.Enabled = true;
                        supplyWindwoolClothTextBox.Enabled = true;
                        break;
                    }
                case 3:     //Everything
                    {
                        profileMiningTextBox.Enabled = true;
                        profileHerbalismTextBox.Enabled = true;
                        profileSkinningTextBox.Enabled = true;
                        profileFishingTextBox.Enabled = true;
                        profileClothesTextBox.Enabled = true;

                        supplyGhostIronOreTextBox.Enabled = true;
                        supplyShaCrystalTextBox.Enabled = true;
                        supplyMysteriousEssenceTextBox.Enabled = true;
                        supplyHerbsTextBox.Enabled = true;
                        supplyLivingSteelTextBox.Enabled = true;
                        supplyTrilliumBarTextBox.Enabled = true;
                        supplyGhostIronBarTextBox.Enabled = true;
                        supplyExoticLeatherTextBox.Enabled = true;
                        supplyPrismaticScaleTextBox.Enabled = true;
                        supplyWindwoolClothTextBox.Enabled = true;
                        break;
                    }
                default:
                    {
                        profileMiningTextBox.Enabled = false;
                        profileHerbalismTextBox.Enabled = false;
                        profileSkinningTextBox.Enabled = false;
                        profileFishingTextBox.Enabled = false;

                        supplyGhostIronOreTextBox.Enabled = false;
                        supplyShaCrystalTextBox.Enabled = false;
                        supplyMysteriousEssenceTextBox.Enabled = false;
                        supplyHerbsTextBox.Enabled = false;
                        supplyLivingSteelTextBox.Enabled = false;
                        supplyTrilliumBarTextBox.Enabled = false;
                        supplyGhostIronBarTextBox.Enabled = false;
                        supplyExoticLeatherTextBox.Enabled = false;
                        supplyPrismaticScaleTextBox.Enabled = false;
                        supplyWindwoolClothTextBox.Enabled = false;
                        break;
                    }

            }
        }



        

        
    }
}
